home *** CD-ROM | disk | FTP | other *** search
/ MacWorld Secrets (4th Edition) / Mac Secrets CD 4th Ed.toast / Apple Advanced Technologies / Apple Speech Technologies 1.5 / PlainTalk Developer Info / Speech Recognition Manager SDK / SR Sample Code / IM SR Example / MyInitSpeechRecognition.c < prev    next >
C/C++ Source or Header  |  1996-04-10  |  704b  |  27 lines

  1. #include <SpeechRecognition.h>
  2.  
  3. extern Boolean    MyHasSpeechRecognitionMgr (void);
  4. extern OSErr    MySetRejectedWordRefCon (SRRecognitionSystem mySystem);
  5.  
  6. SRRecognitionSystem MyInitSpeechRecognition (void);
  7.  
  8. SRRecognitionSystem MyInitSpeechRecognition (void)
  9. {
  10.     OSErr                        myErr;
  11.     SRRecognitionSystem            mySystem = NULL;
  12.     
  13.     if (MyHasSpeechRecognitionMgr()) {
  14.         myErr = SROpenRecognitionSystem (&mySystem, kSRDefaultRecognitionSystemID);
  15.         
  16.         if (!myErr) {
  17.             short myModes = kSRHasFeedbackHasListenModes;
  18.             myErr = SRSetProperty (mySystem, kSRFeedbackAndListeningModes, 
  19.                                                         &myModes, sizeof (myModes));
  20.         }
  21.         
  22.         if (!myErr)
  23.             myErr = MySetRejectedWordRefCon (mySystem);
  24.     }
  25.     
  26.     return (mySystem);
  27. }